home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / COMMUNIC / COMMUTIL / 2258.ZIP / ONCEADAY.ZIP / ONCEADAY.DOC next >
Text File  |  1989-12-20  |  5KB  |  119 lines

  1.                                ONCEADAY.EXE V1.00
  2.                                ------------------
  3.                                Batch File Utility
  4.  
  5.      20th December 1989
  6.  
  7.      Disclaimer
  8.      ----------
  9.  
  10.      This program is being put  into  the  Public  Domain and may be freely
  11.      distributed  on  the  understanding  that  no  responsibility  can  be
  12.      accepted for any problems arising  from  its  use.  To the best of our
  13.      knowledge, it is 'Bug free' and serves its intended purpose.
  14.  
  15.      No charge, other than a nominal charge for duplication and postage may
  16.      be made for it and it should only  be  supplied as a single ARC or ZIP
  17.      file called ONCEADAY.ARC, or ONCEADAY.ZIP, containing the ONCEADAY.EXE
  18.      and ONCEADAY.DOC files.
  19.  
  20.      Overview
  21.      --------
  22.  
  23.      OnceADay is a very simple program  with  one  object. Every time it is
  24.      run, it returns an  errorcode  to  the  batch  file  from which it was
  25.      called. If the program has already  been  exectuted in the curent day,
  26.      it returns an errorlevel of 1, otherwise, an errorlevel of 0.
  27.  
  28.      This provides a simple mechanism for determining whether a part of the
  29.      batch file is to be executed or  not, allowing you to only run certain
  30.      programs if they have not already been run that day.
  31.  
  32.      The program was originally  written  for  use  with the EaziLink comms
  33.      program in Host Mode, so that  certain programs would only update data
  34.      once a day instead of every time the program recycled.
  35.  
  36.      OnceADay is equally useful in  other  circumstances,  such as when you
  37.      have a program in your AUTOEXEC.BAT  file  which  you only want to run
  38.      the first time you boot the computer each day.
  39.  
  40.  
  41.      Running ONCEADAY
  42.      ----------------
  43.  
  44.      ONCEADAY.EXE should be placed in  any  directory which is specified by
  45.      the PATH command.
  46.  
  47.      The syntax used to run OnceADay is:-
  48.  
  49.             ONCEADAY <pathname>
  50.  
  51.      <pathname> may be the name of  any  file  on  any  valid drive and may
  52.                 include the full path and drive letter.
  53.  
  54.      NOTE: The file specified by  pathname  may  be  a special file for the
  55.            purpose, or any existing  file.  Whenever  OnceADay  is run, the
  56.            time and date stamp of the  file  will be changed to the current
  57.            date  and  time  of  the   computer's  clock.  You  should  not,
  58.            therefore, specify the name of  a  file  if it is important that
  59.            the date of that file is not changed!
  60.  
  61.  
  62.      What The Program Does
  63.      ---------------------
  64.  
  65.      Whenever ONCEADAY is run, the  current  date  of the specified file is
  66.      read and compared with  the  date  according  to the computer's system
  67.      clock. If the date is the same, an Errorlevel of 1 is returned. If the
  68.      dates differ, errorlevel  equals  0.  This  enables  you  to check the
  69.      errorlevel in the  batch  file,  on  return  from  the  program and to
  70.      conditionally GOTO a different part  of  the  batch file, depending on
  71.      the result. See the example batch file below.
  72.  
  73.      Irrespective of whether the date  is  the  same  or not, the specified
  74.      file's time/date stamp is updated  to  the system clock's current time
  75.      and date before the program terminates.
  76.  
  77.      OnceADay was written to make use  of  a specified file rather than its
  78.      own date and time, so that it may  be run from any number of different
  79.      batch files, but always compares the  date and time with the specified
  80.      file. This ensures that it always  returns  the right answer even when
  81.      different batch files are run.
  82.  
  83.  
  84.      A Sample Batch File
  85.      -------------------
  86.  
  87.      The following is an example of  a  batch file called RECYCLE.BAT which
  88.      is run every time that EaziLink's Host Mode re-cycles after a caller.
  89.  
  90.          ECHO OFF
  91.          REM Run programs her if you want, every time the batch file runs.
  92.          ONCEADAY C:\EAZILINK\HOSTMAIN\RECYLE.BAT
  93.          IF ERRORLEVEL==1 GOTO END
  94.          REM Execute the remaining lines only if errorlevel = 0
  95.          REM Insert programs to be executed only once a day here.
  96.          :END
  97.  
  98.      In the above example,  the  name  of  the  batch  file  is used as the
  99.      parameter, but  it  could  just  as  easily  have  been  a  dummy file
  100.      specially for the purpose, or any other file.
  101.  
  102.  
  103.      Update History
  104.      --------------
  105.  
  106.      Version
  107.      1.00 - 20/12/89 - Initial release.
  108.  
  109.  
  110.      David Foster
  111.      H.L.C. Services
  112.      High Leys
  113.      Crook
  114.      Kendal
  115.      Cumbria
  116.      LA8 8LF
  117.  
  118.                                       END
  119.